const { validator } = require('../validator')

const createValidator = validator({
  name: { type: 'string', required: true, maxLength: 64 },
  owner_id: { type: 'int', required: true },
  remark: { type: 'string', maxLength: 255 },
})

const updateValidator = validator({
  id: { type: 'int', required: true },
  name: { type: 'string', maxLength: 64 },
  owner_id: { type: 'int', required: true },
  remark: { type: 'string', maxLength: 255 },
})

const getValidator = validator({
  id: { type: 'int', required: true },
})

const delValidator = validator({
  id: { type: 'int', required: true },
})

const listValidator = validator({
  pageNo: { type: 'int', required: true },
  pageSize: { type: 'int', required: true },
})

module.exports = {
  createValidator,
  getValidator,
  delValidator,
  listValidator,
  updateValidator,
}
